#include <iostream>
#include <map>
#include <iomanip>

int main() {
    int N;
    std::cin >> N;

    std::cin.ignore(); // 忽略换行符

    std::map<std::string, int> treeCount;

    // 统计每种树的数量
    for (int i = 0; i < N; i++) {
        std::string treeType;
        std::getline(std::cin, treeType);

        // 将种类名称转换为小写
        for (char& c : treeType) {
            c = std::tolower(c);
        }

        // 更新种类的数量
        treeCount[treeType]++;
    }

    // 计算总数
    int totalCount = 0;
    for (const auto& pair : treeCount) {
        totalCount += pair.second;
    }

    // 输出结果
    std::cout << std::fixed << std::setprecision(4);
    for (const auto& pair : treeCount) {
        std::string treeType = pair.first;
        int count = pair.second;
        double percentage = static_cast<double>(count) / totalCount * 100;

        std::cout << treeType << " " << percentage << "%" << std::endl;
    }

    return 0;
}                    